package example.chapter4;

import com.opensymphony.xwork2.ActionSupport;

import example.model.Product;

public class ProductAction extends ActionSupport{
	private Product product;
	
	public String addProductForm() throws Exception{
		return SUCCESS;
	}
	
	public String addProduct() throws Exception{
		System.out.println(">>>>>addProduct.action:");
		if(null != product){
			System.out.println("product.name = " + product.getName());
			System.out.println("product.modelNo = " + product.getModelNo());
		}
		return SUCCESS;
	}
	
	public String viewProduct() throws Exception{
		System.out.println(">>>>>viewProduct.action:");
		if(null != product){
			System.out.println("product.name = " + product.getName());
			System.out.println("product.modelNo = " + product.getModelNo());
		}
		return SUCCESS;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
	
}
